using System;
using System.ComponentModel.DataAnnotations;
using HengTong.Model._Admin;
using WalkingTec.Mvvm.Core;

namespace HengTong.Model.Db.System;

/// <summary>
/// 系统待办中心实体类
/// 用于管理和跟踪各种业务流程中的待办事项
/// </summary>
/// <remarks>
/// 该类继承自TopBasePoco，包含了完整的待办事项信息，
/// 包括基本信息、组织信息、人员信息、状态信息和时间信息等
/// </remarks>
public class SysTodoCenter : TopBasePoco
{
    /// <summary>
    /// 获取或设置待办事项的标题
    /// </summary>
    /// <value>待办事项的标题，不能为空，最大长度256字符</value>
    [Display(Name = "标题", Description = "待办事项的标题", GroupName = "基本信息")]
    [Required(ErrorMessage = "标题不能为空")]
    [MaxLength(256)]
    public string Title { get; set; }
    
    /// <summary>
    /// 获取或设置单据编码
    /// </summary>
    /// <value>待办事项关联的业务单据编码，最大长度128字符</value>
    [Display(Name = "单据编码", Description = "待办事项的单据编码", GroupName = "基本信息")]
    [StringLength(128)]
    public string BillCode { get; set; }

    /// <summary>
    /// 处理该待办的页面路由
    /// </summary>
    /// <value>处理该待办事项的页面路由地址，最大长度512字符</value>
    [Display(Name = "路由", Description = "处理该待办的页面路由", GroupName = "基本信息")]
    public SysBillRoute Route { get; set; }
    
    /// <summary>
    /// 处理该待办的页面路由路由 ID
    /// </summary>
    [Display(Name = "路由ID", Description = "处理该待办的页面路由ID", GroupName = "基本信息")]
    public Guid? RouteId { get; set; }
    
    /// <summary>
    /// 业务 ID
    /// </summary>
    [StringLength(128)]
    public string BusinessId { get; set; }

    /// <summary>
    /// 获取或设置业务类型
    /// </summary>
    /// <value>待办事项所属的业务类型分类，最大长度64字符</value>
    [Display(Name = "业务类型", Description = "待办事项的业务类型", GroupName = "基本信息")]
    [MaxLength(64)]
    public string BusinessType { get; set; }

    /// <summary>
    /// 获取或设置流程节点ID
    /// </summary>
    /// <value>流程节点ID</value>
    [Display(Name = "流程节点ID", Description = "流程节点ID", GroupName = "基本信息")]
    [StringLength(64)]
    public string ActivityId { get; set; }
    
    /// <summary>
    /// 获取或设置业务ID步骤编号
    /// </summary>
    /// <value>业务ID的步骤编号，用于标识流程节点在流程中的具体步骤</value>
    [Display(Name = "步骤编号", Description = "业务ID的步骤编号", GroupName = "基本信息")]
    public int? Step { get; set; }

    /// <summary>
    /// 获取或设置工作流实例ID
    /// </summary>
    /// <value>工作流引擎中流程实例的唯一标识，最大长度128字符</value>
    [Display(Name = "流程实例ID", Description = "工作流实例的唯一标识", GroupName = "流程信息")]
    [StringLength(128)]
    public string WorkflowId { get; set; }

    /// <summary>
    /// 获取或设置公司名称
    /// </summary>
    /// <value>待办事项所属的公司名称，最大长度128字符</value>
    [Display(Name = "公司名称", Description = "待办事项所属公司", GroupName = "组织信息")]
    [MaxLength(128)]
    public string Company { get; set; }

    /// <summary>
    /// 获取或设置部门名称
    /// </summary>
    /// <value>待办事项所属的部门名称，最大长度128字符</value>
    [Display(Name = "部门名称", Description = "待办事项所属部门", GroupName = "组织信息")]
    [MaxLength(128)]
    public string Department { get; set; }

    /// <summary>
    /// 获取或设置发起人姓名
    /// </summary>
    /// <value>流程或待办事项的发起人姓名，最大长度64字符</value>
    [Display(Name = "发起人姓名", Description = "流程发起人的姓名", GroupName = "人员信息")]
    [MaxLength(64)]
    public string Submitter { get; set; }
    
    /// <summary>
    /// 获取或设置处理人
    /// </summary>
    /// <value>当前负责处理该待办事项的人员姓名，最大长度128字符</value>
    [Display(Name = "处理人", Description = "处理人", GroupName = "人员信息")]
    [StringLength(128)]
    public string Approver { get; set; }
    
    /// <summary>
    /// 获取或设置创建人
    /// </summary>
    /// <value>创建该待办记录的用户姓名，最大长度128字符</value>
    [Display(Name = "创建人", Description = "创建人", GroupName = "人员信息")]
    [StringLength(128)]
    public string CreateBy { get; set; }
    
    /// <summary>
    /// 获取或设置办理结果
    /// </summary>
    /// <value>待办事项的最终处理结果描述，最大长度128字符</value>
    [Display(Name = "办理结果", Description = "待办事项的处理结果", GroupName = "状态信息")]
    [StringLength(128)]
    public string ApproveResult { get; set; }
    
    /// <summary>
    /// 获取或设置办理状态
    /// </summary>
    /// <value>待办事项当前的处理状态，使用TodoStatusEnum枚举值</value>
    [Display(Name = "办理状态", Description = "待办事项的处理状态", GroupName = "状态信息")]
    public TodoStatusEnum? Status { get; set; }

    /// <summary>
    /// 获取或设置优先级
    /// </summary>
    /// <value>待办事项的重要程度级别，使用PriorityEnum枚举值</value>
    [Display(Name = "优先级", Description = "待办事项的优先级", GroupName = "状态信息")]
    public PriorityEnum? Priority { get; set; }

    /// <summary>
    /// 获取或设置创建时间
    /// </summary>
    /// <value>待办事项记录的创建时间</value>
    [Display(Name = "创建时间", Description = "待办事项的创建时间", GroupName = "时间信息")]
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 获取或设置到期时间
    /// </summary>
    /// <value>待办事项需要完成的截止时间，可为空</value>
    [Display(Name = "到期时间", Description = "待办事项的到期处理时间", GroupName = "时间信息")]
    public DateTime? DueDate { get; set; }

    /// <summary>
    /// 获取或设置完成时间
    /// </summary>
    /// <value>待办事项实际完成的时间，可为空</value>
    [Display(Name = "完成时间", Description = "待办事项的完成时间", GroupName = "时间信息")]
    public DateTime? CompleteTime { get; set; }
}

/// <summary>
/// 待办状态枚举
/// 定义待办事项的各种处理状态
/// </summary>
public enum TodoStatusEnum
{
    /// <summary>
    /// 待办状态 - 待处理的事项
    /// </summary>
    [Display(Name = "待办")]
    待办 = 1,
    
    /// <summary>
    /// 已办状态 - 已经处理完成的事项
    /// </summary>
    [Display(Name = "已办")]
    已办 = 2,
    
    /// <summary>
    /// 已协同状态 - 已经进行协同处理的事项
    /// </summary>
    [Display(Name = "已协同")]
    已协同 = 3,
    
    /// <summary>
    /// 我的提交状态 - 当前用户提交的事项
    /// </summary>
    [Display(Name = "我的提交")]
    我的提交 = 10
}

/// <summary>
/// 优先级枚举
/// 定义待办事项的重要程度等级
/// </summary>
public enum PriorityEnum
{
    /// <summary>
    /// 低优先级 - 不紧急的事项
    /// </summary>
    [Display(Name = "低")]
    低 = 1,
    
    /// <summary>
    /// 普通优先级 - 常规处理的事项
    /// </summary>
    [Display(Name = "普通")]
    普通 = 2,
    
    /// <summary>
    /// 高优先级 - 需要优先处理的事项
    /// </summary>
    [Display(Name = "高")]
    高 = 3,
    
    /// <summary>
    /// 紧急优先级 - 需要立即处理的事项
    /// </summary>
    [Display(Name = "紧急")]
    紧急 = 4
}